package com.yvtian.om.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.om.pojo.OmMrpItemEntity;
import com.yvtian.om.dao.OmMrpItemMapper;
import com.yvtian.om.service.OmMrpItemService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * mrp运算详情(om_mrp_item)表服务实现类
 *
 * @author long
 * @since 2024-07-05 09:58:32
 */
@Service("omMrpItemService")
public class OmMrpItemServiceImpl extends ServiceImpl<OmMrpItemMapper, OmMrpItemEntity> implements OmMrpItemService {

    @Override
    public IPage<OmMrpItemEntity> findByPage(Page<OmMrpItemEntity> page, OmMrpItemEntity omMrpItemEntity) {
        LambdaQueryWrapper<OmMrpItemEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(omMrpItemEntity.getZcode())){
            queryWrapper.eq(OmMrpItemEntity::getZcode,omMrpItemEntity.getZcode());
        }
        return this.page(page, queryWrapper);
    }
}

